From f85ea35b4efdbd12ec1a29356a55dbee283c6ed8 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Thu, 17 Apr 2025 19:21:49 +0200 Subject: [PATCH] fix(autotests): do not remove read-only files already removed the sync engine will remove invalid items inside read-only folders not needed to remove them in tests and rather checks that they were indeed removed Signed-off-by: Matthieu Gallien --- test/testpermissions.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/testpermissions.cpp b/test/testpermissions.cpp index 6bd3723fa..38970d8ef 100644 --- a/test/testpermissions.cpp +++ b/test/testpermissions.cpp @@ -141,7 +141,7 @@ private slots: const auto result = FileSystem::remove(fileInfoToDelete.absoluteFilePath(), &errorString); if (!result) { qDebug() << "fail to delete:" << fileInfoToDelete.absoluteFilePath() << errorString; - //QVERIFY(result); + QVERIFY(result); } } else { const auto result = FileSystem::removeRecursively(fileInfoToDelete.absoluteFilePath()); @@ -282,8 +282,6 @@ private slots: // The file should not exist on the remote, and not be there QVERIFY(!currentLocalState.find("readonlyDirectory_PERM_M_/newFile_PERM_WDNV_.data")); QVERIFY(!fakeFolder.currentRemoteState().find("readonlyDirectory_PERM_M_/newFile_PERM_WDNV_.data")); - // remove it so next test succeed. - removeReadOnly("readonlyDirectory_PERM_M_/newFile_PERM_WDNV_.data"); // Both side should still be the same QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); @@ -365,8 +363,8 @@ private slots: QVERIFY(currentLocalState.find("readonlyDirectory_PERM_M_/subdir_PERM_CK_/subsubdir_PERM_CKDNV_/normalFile_PERM_WVND_.data" )); // new no longer exists QVERIFY(!currentLocalState.find("readonlyDirectory_PERM_M_/newname_PERM_CK_/subsubdir_PERM_CKDNV_/normalFile_PERM_WVND_.data" )); - // but is not on server: so remove it locally for the future comparison - removeReadOnly("readonlyDirectory_PERM_M_/newname_PERM_CK_"); + // but is not on server: should have been locally removed + QVERIFY(!currentLocalState.find("readonlyDirectory_PERM_M_/newname_PERM_CK_")); //2. // old removed @@ -375,8 +373,8 @@ private slots: QVERIFY(fakeFolder.currentRemoteState().find("normalDirectory_PERM_CKDNV_/subdir_PERM_CKDNV_")); // new no longer exists QVERIFY(!currentLocalState.find("readonlyDirectory_PERM_M_/moved_PERM_CK_/subsubdir_PERM_CKDNV_/normalFile_PERM_WVND_.data" )); - //but not on server - removeReadOnly("readonlyDirectory_PERM_M_/moved_PERM_CK_"); + // should have been cleaned up as invalid item inside read-only folder + QVERIFY(!currentLocalState.find("readonlyDirectory_PERM_M_/moved_PERM_CK_")); fakeFolder.remoteModifier().remove("normalDirectory_PERM_CKDNV_/subdir_PERM_CKDNV_"); QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); -- 2.30.2